<template>
    <div class="big-box">
        <div class="header">
            <img src="../../../../../assets/bigScreen/header3.png" alt="" />
            <div class="backBox" @click="goBack"></div>
        </div>
        <div class="backToBox">
            <div class="backTo" @click="gotoHome">
                <div>返回总窗口</div>
            </div>
            <div class="backTo" @click="backToOne">
                <div>返回上一页</div>
            </div>
        </div>
        <div class="centerBox">
            <div class="sreenTitle">科技成果</div>
            <div class="center">
            <div class="page">
                <div class="page-title">{{ detail.name }}</div>
                <div class="add-box">
                    <div class="add-title">详细信息</div>
                </div>
                <div class="table-container">
                    <div class="table-box">
                        <div class="table-row">
                            <div class="table-label">所属领域</div>
                            <div class="table-value">{{ detail.demandArea && detail.demandArea.note }}</div>
                        </div>
                        <div class="table-row">
                            <div class="table-label">行业类型</div>
                            <div class="table-value">{{ detail.industry }}</div>
                        </div>
                        <div class="table-row">
                            <div class="table-label">知识产权有效时间</div>
                            <div class="table-value">{{ detail.propertyInfo }}</div>
                        </div>
                        <div class="table-row">
                            <div class="table-label">成果所处阶段</div>
                            <div class="table-value">{{ detail.stage && detail.stage.note }}</div>
                        </div>
                        <div class="table-row">
                            <div class="table-label">所在地区</div>
                            <div class="table-value">{{ detail.areaCode }}</div>
                        </div>
                        <!-- <div class="table-row">
						<div class="table-label">专利号</div>
						<div class="table-value">{{ detail.technicalLevel }}</div>
					</div> -->
                    </div>
                    <div class="table-box">
                        <div class="table-row">
                            <div class="table-label">联系电话</div>
                            <div class="table-value">{{ detail.contactPersonMobile }}</div>
                        </div>
                        <div class="table-row">
                            <div class="table-label">成果形式</div>
                            <div class="table-value">{{ detail.shape && detail.shape.note }}</div>
                        </div>
                        <!-- <div class="table-row">
						<div class="table-label">授权时间</div>
						<div class="table-value">{{ detail.country }}</div>
					</div> -->
                        <div class="table-row">
                            <div class="table-label">完成单位</div>
                            <div class="table-value">{{ detail.belongCompany }}</div>
                        </div>
                        <div class="table-row">
                            <div class="table-label">完成人</div>
                            <div class="table-value">{{ detail.contactPerson }}</div>
                        </div>
                        <div class="table-row" style="border-left:none;border-right:none;border-bottom:none;">
                            <!-- <div class="table-label">完成时间</div>
						<div class="table-value">{{ detail.finishEndTime }}</div> -->
                        </div>
                    </div>
                </div>
                <div class="add-box">
                    <div class="add-title">项目简介</div>
                </div>
                <div class="detail-text" v-html="detail.description || '暂无'"></div>
            </div>
        </div>
        </div>
    </div>
</template>

<script>
import headerBox from '../../../../../components/header.vue';
import headerImg from '../../../../../components/headerImg.vue';
import footerBox from '../../../../../components/footer-box.vue';
import moreBtn from '../../../../../components/more-btn.vue';
import { getResultDet, addPhone } from '../../../../../api/gain.js';
import {
    reactive,
    ref,
    toRaw,
    shallowRef
} from "vue"
import {
    message
} from "ant-design-vue"
export default {
    components: {
        headerBox,
        headerImg,
        footerBox,
        moreBtn
    },
    data() {
        return {
            detail: {},
            form: {

            },
            labelCol: {
                span: 4
            },
            wrapperCol: {
                span: 14
            },
            rules: {
                name: [{
                    required: true,
                    message: '请输入姓名',
                    trigger: 'blur'
                }],
                phone: [{
                    required: true,
                    message: '请输入手机号码',
                    trigger: 'blur'
                }],
                deptName: [{
                    required: true,
                    message: '请输入单位名称',
                    trigger: 'blur'
                }],
                remark: [{
                    required: true,
                    message: '请输入备注',
                    trigger: 'blur'
                }],
            }
        }
    },
    mounted() {
        this.getDet(this.$route.query.id);
    },
    methods: {
        getDet(id) {
            getResultDet(id).then(res => {
                if (res.code === 200) {
                    this.detail = res.data;
                    this.detail.areaCode = this.detail.areaInfoList.map((item) => item.name).join('')
                }
            })
        },
        submit() {
            let data = toRaw(this.form)
            data.type = '5'
            data.demandId = this.detail.id
            data.title = this.detail.name
            data.publisher = this.detail.belongCompany
            let phoneReg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
            if (data.phone != '') {
                if (!(phoneReg.test(data.phone))) {
                    message.info('请输入正确的手机号')
                    return false
                }
            }
            addPhone(data).then(res => {
                if (res.code == 200) {
                    message.success('新增成功')
                    this.$router.go(-1)
                }
            })
        },
        gotoHome() {
            this.$router.push({
                path: '/bigScreenIndex',
            })
        },
        backToOne() {
            console.log('11');
            this.$router.go(-1)
        },
        goBack() {
            this.$router.push('/chart')
        }
        // gotoAdd() {
        // 	this.$router.push({
        // 		path: 'addIntention'
        // 	})
        // }
    }
}
</script>

<style scoped lang="scss">
@font-face {
    font-family: "ffa";
    src: url(../../../assets/bigScreen/fonts/DS-DIGIB.TTF);
}
ul,
li {
    list-style: none;
}
.big-box {
    background-color: #071c3b;
    height: 100vh;
}
.header {
    position: relative;
    text-align: center;
    position: relative;
    height: 19.1rem;

    .backBox {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 70rem;
        height: 10rem;
        cursor: pointer;
    }

    > img {
        width: 100%;
        max-height: 100%;
        margin-top: -1.1rem;
        image-rendering: -moz-crisp-edges; /* Firefox */
        image-rendering: -o-crisp-edges; /* Opera */
        image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
        image-rendering: crisp-edges;
        -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
    }
}
.centerBox {
    width: 96%;
    margin: 0 auto;
    position: absolute;
    top: 14rem;
    left: 2%;
    .sreenTitle {
        background-image: url("../../../../../assets/bigScreen/sreenTitle.png");
        background-size: 100% 100%;
        height: 3.8rem;
        padding-left: 35px;
        font-weight: 600;
        color: #fff;
        display: flex;
        align-items: center;
    }
    .center {
        margin-top: 1rem;
        height: calc(100vh - 20rem);
        border: 1px solid;
        border-image: linear-gradient(
                130deg,
                #2385df 0%,
                rgba(35, 133, 223, 0.65) 92%
            )
            1;
        overflow-y: scroll;
        padding: 20px;
        .page {
            width: 136rem;
            margin: 0 auto;
            // background-color: #ffffff;
            padding: 2rem;
        }
        .add-box {
            width: 100%;
            height: 6.5rem;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #4494ff60;
            .add-title {
                display: flex;
                align-items: center;
                font-size: 2.2rem;
                font-weight: bold;
                color: #fff;
                &::before {
                    content: "";
                    display: block;
                    width: 0.5rem;
                    height: 3rem;
                    background: #037aff;
                    margin-right: 1rem;
                }
            }
            .add-btn {
                width: 13rem;
                height: 4.5rem;
                text-align: center;
                line-height: calc(4.5rem - 4px);
                border-radius: 4px;
                border: 1px solid #037aff;
                font-size: 1.6rem;
                color: #037aff;
                cursor: pointer;
            }
        }
        .product-container {
            width: 136rem;
            margin: 3rem auto;
            display: flex;
            flex-wrap: wrap;
            .product-item {
                width: 42.7rem;
                height: max-content;
                display: inline-block;
                margin-right: 2rem;
                margin-bottom: 2rem;
                padding: 2rem;
                background: #ffffff;
                border-radius: 8px;
                cursor: pointer;
                border: 1px solid #eeeeee;
                overflow: hidden;
                &:nth-child(3n + 3) {
                    margin-right: 0;
                }
            }
            .product-item.last {
                margin-left: 1.5rem;
            }
            .product-title {
                height: 2.4rem;
                margin-bottom: 2rem;
                font-size: 1.8rem;
                font-weight: bold;
                color: #232323;
            }
            .product-text {
                height: 5rem;
                line-height: 2.5rem;
                font-size: 1.6rem;
                color: #565656;
            }

            .product-tag-box {
                width: 100%;
                border-bottom: 1px solid #eeeeee;
                display: flex;
            }
            .product-tag-box.none-br {
                border-bottom: none;
            }
            .product-tag-box.none-br .product-tag {
                margin-bottom: 0;
            }
            .product-tag {
                margin: 2rem 0;
                margin-right: 0.8rem;
                padding: 0.4rem 1.5rem;
                background: #e5f1fe;
                border-radius: 4px;
                font-size: 1.3rem;
                color: #037aff;
                &.yellow {
                    color: #ff8f1f;
                    background: rgba(255, 143, 31, 0.1);
                }
            }
            .star-box {
                width: 100%;
                height: 2.5rem;
                line-height: 2.5rem;
                margin-top: 2rem;
                display: flex;
                justify-content: space-between;
            }
            .star-title {
                font-size: 1.6rem;
                color: #565656;
            }
            .star-title span {
                color: #f06300;
            }
            .star-container {
                float: right;
            }
            .star-container img {
                width: 2.4rem;
                height: 2.4rem;
                margin-left: 0.5rem;
            }
        }
        .table-container {
            display: flex;
            .table-box {
                flex: 1;
                display: flex;
                flex-direction: column;
                text-align: center;
                line-height: 5rem;
                margin: 2rem 0;
                &:last-child {
                    margin-left: 1rem;
                }
                .table-row {
                    flex: 1;
                    display: flex;
                    border: 1px solid #4494ff60;
                    border-bottom: none;
                    &:last-child {
                        border-bottom: 1px solid #4494ff60;
                    }
                    .table-label {
                        flex: 1;
                        background: #104B99;
                        border-right: 1px solid #4494ff60;
                        font-size: 1.6rem;
                        color: #ffffff;
                        font-weight: bold;
                    }
                    .table-value {
                        flex: 2;
                        font-size: 1.7rem;
                        color: rgba(255, 255, 255, 0.85);
                    }
                }
            }
        }
        .detail-text {
            margin: 2rem 0;
            font-size: 1.8rem;
            color: rgba(255, 255, 255, 0.85);
        }

        .page-title {
            font-size: 3.6rem;
            color: #fff;
            margin: 3rem auto;
            text-align: center;
        }
    }
    ::-webkit-scrollbar {
        width: 5px;
        height: 10px;
    }

    /* 滚动条轨道 */
    ::-webkit-scrollbar-track {
        background-color: #234470;
    }

    /* 滚动条滑块 */
    ::-webkit-scrollbar-thumb {
        background-color: #061c57;
    }

    /* 鼠标悬停在滚动条上的滑块 */
    ::-webkit-scrollbar-thumb:hover {
        background-color: #555;
    }
}
.backToBox {
    position: absolute;
    top: 8rem;
    right: 2%;
    display: flex;
    z-index: 10;
    .backTo {
        background-image: url("../../../../../assets/bigScreen/backTo.png");
        color: #2dccff;
        background-size: 100% 100%;
        width: fit-content;
        padding: 2px 40px 10px 10px;
        font-weight: 600;
        cursor: pointer;
        margin-left: 10px;
        div {
            padding-top: 5px;
        }
    }
}
</style>
